<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
 </head>
 <body>
  
 </body>
 <script>
   var str_01 = "HelloWorld";
   //计算字符串的长度 
   console.log("str_01.length="+str_01.length);
   //返回指定位置的字符
   var s = str_01.charAt(6);
   console.log("s.charAt="+s);
   //返回字符串中某个字符的索引
   console.log("str_01.indezOf="+str_01.indexOf("W"));
   //求字符串中的子串
   var str_02 = str_01.substring(2,5);
   console.log("str_02="+str_02);
   //替换字符串中的某个字符
   var str_03 = str_01.replace("o","O");
   console.log("str_03="+str_03);
   //把字符串分割为字符串数组
   var arr_01 = str_01.split("");
   console.log("arr_01="+arr_01);
   for(var i=0;i<arr_01.length;i++){
     console.log(arr_01[i]);
   }
 </script>
</html>
